package cn.java81;

import cn.java81.myschool.dao.SubjectDao;
import cn.java81.myschool.util.MyBatisUtil;

/**
 * Hello world!
 *cn.xxx.Subject ==>Subject
 */
public class App 
{
    public static void main( String[] args )
    {
        for(int i=1;i<=10;i++){
            new Thread(()->{
                MyBatisUtil.getMapper(SubjectDao.class).findALL().forEach(System.out::println);
//                try {
//                    Thread.sleep(4000);
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
                return;
            },"现车"+i).start();

        }
        try {
            Thread.sleep(20000);
            System.out.println(MyBatisUtil.getSessionManager().hashCode()+"???????????");

            MyBatisUtil.getMapper(SubjectDao.class).findALL().forEach(System.out::println);

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println( "Hello World!" );
    }
}
